#ifndef DialogView_First
#define DialogView_First
#ifdef __GNUG__
#pragma interface
#endif

#include "View.h"

//---- DialogView --------------------------------------------------------------

class DialogView: public View {
public:
	MetaDef(DialogView);

	DialogView(EvtHandler *eh= 0);
	~DialogView();

	void Open(bool mode= TRUE);
	void SetOrigin(Point at);
	void SetExtent(Point e);
	void ExtentChanged(VObject *vop);
	Metric GetMinSize();
	virtual VObject *DoCreateDialog();
	void CalcLayout(bool redraw= TRUE);
	VObject *SetDialog(VObject*, bool redraw= TRUE); // returns old dialogtree
	VObject *GetDialogRoot();
	void Draw(Rectangle);
	VObject *Detect(BoolFun f, void *arg);

	//---- event handling
	Command *DispatchEvents(Point lp, Token &t, Clipper*);

	virtual void EnableItem(int id, bool b= TRUE);
	void DisableItem(int id);
	VObject *FindItem(int id);

	//---- keyboard focus
	void CollectParts(class Collection *);

protected:
	VObject *dialogRoot;
};

inline void DialogView::DisableItem(int i)
	{ EnableItem(i, FALSE); }

#endif

